package com.qw.qrweb.mapper;

import com.qw.qrweb.model.entity.ContentEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ContentMapper {

    @Insert("insert into content values (null, #{type}, #{content}, #{time})")
    int addContent(String type, String content, String time);

    @Delete("delete from content where id = #{id}")
    int del(long id);

    @Select("select * from content order by id desc limit 1")
    ContentEntity lastest();

    @Select("SELECT time FROM content ORDER BY id DESC LIMIT 1")
    String getLatestUpdateTime();

}
